package com.tencent.wxcloudrun.controller;


import com.tencent.wxcloudrun.service.RobotService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;


@Slf4j
@RestController
public class RobotController {

    @Autowired
    private RobotService robotService;


    @PostMapping("/chat/completions")
    public ResponseEntity<StreamingResponseBody> chatCompletions(@RequestBody String requestBody) {
        log.info("### /chat/completions ");
        return robotService.chatCompletions(requestBody);
    }

}
